import request from '@/router/axios';

export const resetPassword = (userId) => {
  return request({
    url: '/api/sellerMgr/reset',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
    }
  })
}
export const setRoles = (userId, roleIds) => {
  return request({
    url: '/api/sellerMgr/setRole',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      roleIds
    }
  })
}
export const getList = (page, size, params) => {
  return request({
    url: '/api/sellerMgr/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const remove = (userId) => {
  return request({
    url: '/api/sellerMgr/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/sellerMgr/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/sellerMgr/edit',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const getUser = (userId) => {
  return request({
    url: '/api/sellerMgr/getUserInfo',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
    }
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/api/sellerMgr/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}

export const customerServiceStatus = (userId, status) => {
  return request({
    url: '/api/sellerMgr/customerServiceStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}
